package com.bop.dehong.setting;

import com.base.dehong.base.AdapterBase;
import com.bop.dehong.R;
import com.bop.dehong.info.SystemHeadInfo;
import com.bop.dehong.util.ImageLoaderUtils;
import com.bop.dehong.widget.CircleImageView;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * 系统头像
 * @author Tangwenhan
 *2015-11-20下午5:32:22
 */
public class SystemAvatarAdapter extends AdapterBase<SystemHeadInfo>{

	public SystemAvatarAdapter(Activity context) {
		super(context);
		
	}

	@Override
	public View getView(int arg0, View convertView, ViewGroup arg2) {
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(mContext).inflate(R.layout.item_sytem_avatar_list, null);
			holder.avatarIv = getView(convertView, R.id.imageView1);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		SystemHeadInfo info = get(arg0);
		ImageLoaderUtils.getInstance(mContext).setImageNetResource(holder.avatarIv,info.thumb);
		//记住，收支和余额后面要加“元”
		return convertView;
	}
	
	private class ViewHolder {
		//时间
		private CircleImageView avatarIv;
		
	}

}

